home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / util / misc / ReportPlus.lha / reportplus / source / f11.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-23  |  19.4 KB  |  559 lines

  1. #include <exec/types.h>
  2. #include <proto/exec.h>
  3. #include <intuition/intuition.h>
  4. #include <intuition/gadgetclass.h>
  5. #include <proto/intuition.h>
  6. #include <libraries/gadtools.h>
  7. #include <proto/gadtools.h>
  8.  
  9. #define ALL_REACTION_CLASSES
  10. #define ALL_REACTION_MACROS
  11. #include <reaction/reaction.h>
  12. #include <gadgets/texteditor.h>
  13. #include <clib/texteditor_protos.h>
  14. #include <pragmas/texteditor_pragmas.h>
  15.  
  16. #include <ctype.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include "rp.h"
  20.  
  21. IMPORT  struct AminetStruct aminet;
  22. AGLOBAL struct AGDBStruct   agdb;
  23.  
  24. AGLOBAL struct Gadget*      agdb_gadgets[GIDS_11 + 1];
  25.  
  26. // from rp.c
  27. IMPORT Object*              WinObject[FUNCTIONS + 1];
  28. IMPORT SBYTE                page;
  29. IMPORT struct Window*       MainWindowPtr;
  30. IMPORT struct SharedStruct  shared;
  31. IMPORT struct Screen*       ScreenPtr;
  32. IMPORT struct Menu*         MenuPtr;
  33. IMPORT ULONG                offset,
  34.                             signal;
  35. IMPORT TEXT                 IOBuffer[LONGESTFIELD + 1],
  36.                             aslresult[PATHNAMEFIELD + 1],
  37.                             string[LONGESTFIELD + 1];
  38. IMPORT struct Library*      TextEditorBase;
  39.  
  40. MODULE void updateagdbgadgets(void);
  41. MODULE void readagdbgadgets(void);
  42.  
  43. AGLOBAL void agdb1(void)
  44. {   struct Hook Hook11Struct;
  45.  
  46.     if ((!(aminet.uploader[0])) && readin("S:Report.sender"))
  47.     {   /* # Refer: <last>,<first> (<company> ,phone <phone>)<LF>
  48.            # Path: <email><LF>
  49.            # ReferID: <developer><LF> */
  50.  
  51.         offset = 0;
  52.         parse("# Refer: ");
  53.         parse(",");
  54.         parse(" (");
  55.         parse(" ,phone ");
  56.         parse(")\n# Path: ");
  57.         parse("\n# ReferID: ");
  58.         strcpy(aminet.uploader, string);
  59.     }
  60.  
  61.     InitHook(&Hook11Struct, Hook11Func, NULL);
  62.  
  63.     /* Create the window object. */
  64.     lockscreen();
  65. if (!(WinObject[11] =
  66. NewObject
  67. (
  68.     WINDOW_GetClass(),                    NULL,
  69.     WA_PubScreen,                         ScreenPtr,
  70.     WA_ScreenTitle,                       "Report+",
  71.     WA_Title,                             "Report+: AGDB Review Editor",
  72.     WA_Activate,                          TRUE,
  73.     WA_DepthGadget,                       TRUE,
  74.     WA_DragBar,                           TRUE,
  75.     WA_CloseGadget,                       TRUE,
  76.     WA_SizeGadget,                        TRUE,
  77.     WA_IDCMP,                             IDCMP_RAWKEY,
  78.     WINDOW_IDCMPHook,                     &Hook11Struct,
  79.     WINDOW_IDCMPHookBits,                 IDCMP_RAWKEY,
  80.     WINDOW_MenuStrip,                     MenuPtr,
  81.     WINDOW_Position,                      WPOS_CENTERSCREEN,
  82.     WINDOW_ParentGroup,                   agdb_gadgets[GID_11_LY1] =
  83. NewObject
  84. (   LAYOUT_GetClass(),                NULL,
  85.     LAYOUT_Orientation,               LAYOUT_ORIENT_VERT,
  86.     LAYOUT_SpaceOuter,                TRUE,
  87.     LAYOUT_DeferLayout,               TRUE,
  88.     LAYOUT_AddChild,
  89.     NewObject
  90.     (   LAYOUT_GetClass(),                NULL,
  91.         LAYOUT_Orientation,               LAYOUT_ORIENT_HORIZ,
  92.         LAYOUT_SpaceOuter,                TRUE,
  93.         LAYOUT_DeferLayout,               TRUE,
  94.         LAYOUT_AddChild,
  95.         NewObject
  96.         (   LAYOUT_GetClass(),            NULL,
  97.             LAYOUT_Orientation,           LAYOUT_ORIENT_VERT,
  98.             LAYOUT_SpaceOuter,            TRUE,
  99.             LAYOUT_DeferLayout,           TRUE,
  100.             LAYOUT_AddChild,
  101.             NewObject
  102.             (   LAYOUT_GetClass(),        NULL,
  103.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  104.                 LAYOUT_SpaceOuter,        TRUE,
  105.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  106.                 LAYOUT_BevelStyle,        BVS_NONE,
  107.                 LAYOUT_AddImage,          NewObject
  108.                 (   LABEL_GetClass(),     NULL,
  109.                     LABEL_Text,           "_Title:",
  110.                     LABEL_Justification,  LJ_RIGHT,
  111.                     TAG_END
  112.                 ),
  113.                 TAG_END
  114.             ),
  115.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  116.                 // layout
  117.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  118.                 LAYOUT_SpaceOuter,        TRUE,
  119.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  120.                 LAYOUT_BevelStyle,        BVS_NONE,
  121.                 LAYOUT_AddImage,          NewObject
  122.                 (   LABEL_GetClass(),     NULL,
  123.                     // label
  124.                     LABEL_Text,           "_Publisher (Year):",
  125.                     LABEL_Justification,  LJ_RIGHT,
  126.                     TAG_END
  127.                 ),
  128.                 TAG_END
  129.             ),
  130.             LAYOUT_AddChild,
  131.             NewObject
  132.             (   LAYOUT_GetClass(),        NULL,
  133.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  134.                 LAYOUT_SpaceOuter,        TRUE,
  135.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  136.                 LAYOUT_BevelStyle,        BVS_NONE,
  137.                 LAYOUT_AddImage,          NewObject
  138.                 (   LABEL_GetClass(),     NULL,
  139.                     // label
  140.                     LABEL_Text,           "_Game Type:",
  141.                     LABEL_Justification,  LJ_RIGHT,
  142.                     TAG_END
  143.                 ),
  144.                 TAG_END
  145.             ),
  146.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  147.                 // layout
  148.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  149.                 LAYOUT_SpaceOuter,        TRUE,
  150.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  151.                 LAYOUT_BevelStyle,        BVS_NONE,
  152.                 LAYOUT_AddImage,          NewObject
  153.                 (   LABEL_GetClass(),     NULL,
  154.                     // label
  155.                     LABEL_Text,           "P_layers:",
  156.                     LABEL_Justification,  LJ_RIGHT,
  157.                     TAG_END
  158.                 ),
  159.                 TAG_END
  160.             ),
  161.             LAYOUT_AddChild,
  162.             NewObject
  163.             (   LAYOUT_GetClass(),        NULL,
  164.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  165.                 LAYOUT_SpaceOuter,        TRUE,
  166.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  167.                 LAYOUT_BevelStyle,        BVS_NONE,
  168.                 LAYOUT_AddImage,          NewObject
  169.                 (   LABEL_GetClass(),     NULL,
  170.                     // label
  171.                     LABEL_Text,           "_Compatibility:",
  172.                     LABEL_Justification,  LJ_RIGHT,
  173.                     TAG_END
  174.                 ),
  175.                 TAG_END
  176.             ),
  177.             LAYOUT_AddChild,
  178.             NewObject
  179.             (   LAYOUT_GetClass(),        NULL,
  180.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  181.                 LAYOUT_SpaceOuter,        TRUE,
  182.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  183.                 LAYOUT_BevelStyle,        BVS_NONE,
  184.                 LAYOUT_AddImage,          NewObject
  185.                 (   LABEL_GetClass(),     NULL,
  186.                     // label
  187.                     LABEL_Text,           "_HD Installable?",
  188.                     LABEL_Justification,  LJ_RIGHT,
  189.                     TAG_END
  190.                 ),
  191.                 TAG_END
  192.             ),
  193.             LAYOUT_AddChild,
  194.             NewObject
  195.             (   LAYOUT_GetClass(),        NULL,
  196.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  197.                 LAYOUT_SpaceOuter,        TRUE,
  198.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  199.                 LAYOUT_BevelStyle,        BVS_NONE,
  200.                 LAYOUT_AddImage,          NewObject
  201.                 (   LABEL_GetClass(),     NULL,
  202.                     LABEL_Text,           "_Submission:",
  203.                     LABEL_Justification,  LJ_RIGHT,
  204.                 TAG_END),
  205.                 CHILD_WeightedWidth,      0,
  206.             TAG_END),
  207.         TAG_END),
  208.         CHILD_WeightedWidth,          0,
  209.         LAYOUT_AddChild,
  210.         NewObject
  211.         (   LAYOUT_GetClass(),        NULL,
  212.             LAYOUT_Orientation,       LAYOUT_ORIENT_VERT,
  213.             LAYOUT_SpaceOuter,        TRUE,
  214.             LAYOUT_VertAlignment,     LALIGN_CENTER,
  215.             LAYOUT_HorizAlignment,    LALIGN_CENTER,
  216.             LAYOUT_BevelStyle,        BVS_NONE,
  217.             LAYOUT_AddChild,          agdb_gadgets[GID_11_ST1] =
  218.             NewObject
  219.             (   STRING_GetClass(),    NULL,
  220.                 GA_ID,                GID_11_ST1,
  221.                 GA_TabCycle,          TRUE,
  222.                 STRINGA_TextVal,      agdb.title,
  223.                 STRINGA_MinVisible,   20,
  224.                 STRINGA_MaxChars,     58,
  225.             TAG_END),
  226.             LAYOUT_AddChild,          agdb_gadgets[GID_11_ST2] =
  227.             NewObject
  228.             (   STRING_GetClass(),    NULL,
  229.                 GA_ID,                GID_11_ST2,
  230.                 GA_TabCycle,          TRUE,
  231.                 STRINGA_TextVal,      agdb.publisher,
  232.                 STRINGA_MinVisible,   20,
  233.                 STRINGA_MaxChars,     58,
  234.             TAG_END),
  235.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST3] =
  236.                                   NewObject(STRING_GetClass(), NULL,
  237.                 // string        
  238.                 GA_ID,                GID_11_ST3,
  239.                 GA_TabCycle,          TRUE,
  240.                 STRINGA_TextVal,      agdb.gametype,
  241.                 STRINGA_MinVisible,   20,
  242.                 STRINGA_MaxChars,     58,
  243.             TAG_END),
  244.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST4] =
  245.                                   NewObject(STRING_GetClass(), NULL,
  246.                 // string        
  247.                 GA_ID,                GID_11_ST4,
  248.                 GA_TabCycle,          TRUE,
  249.                 STRINGA_TextVal,      agdb.players,
  250.                 STRINGA_MinVisible,   20,
  251.                 STRINGA_MaxChars,     58,
  252.             TAG_END),
  253.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST5] =
  254.                                   NewObject(STRING_GetClass(), NULL,
  255.                 // string        
  256.                 GA_ID,                GID_11_ST5,
  257.                 GA_TabCycle,          TRUE,
  258.                 STRINGA_TextVal,      agdb.hdinstallable,
  259.                 STRINGA_MinVisible,   20,
  260.                 STRINGA_MaxChars,     58,
  261.             TAG_END),
  262.             LAYOUT_AddChild,          agdb_gadgets[GID_11_ST6] =
  263.             NewObject
  264.             (   STRING_GetClass(),    NULL,
  265.                 GA_ID,                GID_11_ST6,
  266.                 GA_TabCycle,          TRUE,
  267.                 STRINGA_TextVal,      agdb.compatibility,
  268.                 STRINGA_MinVisible,   20,
  269.                 STRINGA_MaxChars,     58,
  270.             TAG_END),
  271.             LAYOUT_AddChild,          agdb_gadgets[GID_11_ST7] =
  272.             NewObject
  273.             (   STRING_GetClass(),    NULL,
  274.                 GA_ID,                GID_11_ST7,
  275.                 GA_TabCycle,          TRUE,
  276.                 STRINGA_TextVal,      aminet.uploader,
  277.                 STRINGA_MinVisible,   20,
  278.                 STRINGA_MaxChars,     58,
  279.             TAG_END),
  280.             CHILD_WeightedHeight,     0,
  281.         TAG_END),
  282.         CHILD_WeightedHeight,         0,
  283.     TAG_END),
  284.     CHILD_WeightedHeight,             0,
  285.     LAYOUT_AddChild,                  NewObject
  286.     (   LAYOUT_GetClass(),            NULL,
  287.         LAYOUT_Orientation,           LAYOUT_ORIENT_HORIZ,
  288.         LAYOUT_SpaceOuter,            TRUE,
  289.         LAYOUT_HorizAlignment,        LALIGN_CENTER,
  290.         LAYOUT_BevelStyle,            BVS_NONE,
  291.         LAYOUT_AddImage,              NewObject
  292.         (   LABEL_GetClass(),         NULL,
  293.             LABEL_Text,               "_Review:",
  294.             LABEL_Justification,      LJ_CENTER,
  295.         TAG_END),
  296.     TAG_END),
  297.     CHILD_WeightedHeight,             0,
  298.     LAYOUT_AddChild,                  agdb_gadgets[GID_11_TE1] =
  299.     NewObject
  300.     (   TEXTEDITOR_GetClass(),        NULL,
  301.         GA_ID,                        GID_11_TE1,
  302.         GA_RelVerify,                 TRUE,
  303.         GA_TEXTEDITOR_ExportWrap,     75,
  304.     TAG_END),
  305.     CHILD_WeightedHeight,             100,
  306.     CHILD_MinHeight,                  128,
  307. TAG_END),
  308. TAG_END)))
  309. {   rq("Can't create ReAction gadgets!");
  310. }
  311. unlockscreen();
  312. openwindow();
  313.  
  314.     SetGadgetAttrs
  315.     (   agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL,
  316.         GA_TEXTEDITOR_Contents,   agdb.textfield
  317.     ); // long description
  318.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_NEW,    NOSUB));
  319.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_OPEN,   NOSUB));
  320.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVE,   NOSUB));
  321.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVEAS, NOSUB));
  322.  
  323.     ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  324.     loop();
  325.     readagdbgadgets();
  326.     closewindow();
  327. }
  328.  
  329. AGLOBAL void saveagdb(ABOOL saveas)
  330. {   /*  Title            <title>
  331.         Publisher        <publisher>
  332.         Game Type        <game type>
  333.         Players          <players>
  334.         HD Installable   <hd installable>
  335.         Compatibility    <compatibility>
  336.         Submission       <uploader>
  337.         
  338.         Review
  339.         <review> */
  340.  
  341.     readagdbgadgets();
  342.  
  343.     strcpy(IOBuffer, "Title:           ");
  344.     strcat(IOBuffer, agdb.title);
  345.     strcat(IOBuffer, "\nPublisher:       ");
  346.     strcat(IOBuffer, agdb.publisher);
  347.     strcat(IOBuffer, "\nGame Type:       ");
  348.     strcat(IOBuffer, agdb.gametype);
  349.     strcat(IOBuffer, "\nPlayers:         ");
  350.     strcat(IOBuffer, agdb.players);
  351.     strcat(IOBuffer, "\nHD Installable:  ");
  352.     strcat(IOBuffer, agdb.hdinstallable);
  353.     strcat(IOBuffer, "\nCompatibility:   ");
  354.     strcat(IOBuffer, agdb.compatibility);
  355.     strcat(IOBuffer, "\nSubmission:      ");
  356.     strcat(IOBuffer, aminet.uploader);
  357.     strcat(IOBuffer, "\n\nReview:\n");
  358.     strcat(IOBuffer, agdb.textfield);
  359.  
  360.     if (!agdb.output[0] || saveas) // if we need a filename
  361.     {   if (saveasl("Save AGDB Review", "~(#?.info)"))
  362.         {   strcpy(agdb.output, aslresult);
  363.             writeout(agdb.output);
  364.     }   }
  365.     else
  366.     {   writeout(agdb.output);
  367. }   }
  368.  
  369. AGLOBAL void agdb_loop(ULONG gid)
  370. {   ; // :-)
  371. }
  372.  
  373. AGLOBAL ULONG Hook11Func(struct Hook *h, VOID *o, VOID *msg)
  374. {   /* "When the hook is called, the data argument points to the 
  375.     window object and message argument to the IntuiMessage." */
  376.  
  377.     UWORD code, qual;
  378.  
  379.     geta4(); // wait till here before doing anything
  380.  
  381.     code = ((struct IntuiMessage *) msg)->Code;
  382.     qual = ((struct IntuiMessage *) msg)->Qualifier;
  383.  
  384.     switch(code)
  385.     {
  386.     case SCAN_HELP:
  387.         helpabout();
  388.     break;
  389.     case SCAN_ESCAPE:
  390.         if ((qual & IEQUALIFIER_LSHIFT) || (qual & IEQUALIFIER_RSHIFT))
  391.         {   cleanexit(EXIT_SUCCESS);
  392.         } else page = 0;
  393.     break;
  394.     case SCAN_T:
  395.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  396.     break;
  397.     case SCAN_P:
  398.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST2]);
  399.     break;
  400.     case SCAN_G:
  401.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST3]);
  402.     break;
  403.     case SCAN_L:
  404.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST4]);
  405.     break;
  406.     case SCAN_C:
  407.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST5]);
  408.     break;
  409.     case SCAN_H:
  410.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST6]);
  411.     break;
  412.     case SCAN_S:
  413.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST7]);
  414.     break;
  415.     case SCAN_R:
  416.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_TE1]);
  417.     break;
  418.     default:
  419.     break;
  420.     }
  421.  
  422.     return(1);
  423. }
  424.  
  425. AGLOBAL void newagdb(ABOOL display)
  426. {   strcpy(agdb.title,         "");
  427.     strcpy(agdb.publisher,     "");
  428.     strcpy(agdb.gametype,      "");
  429.     strcpy(agdb.players,       "");
  430.     strcpy(agdb.hdinstallable, "");
  431.     strcpy(agdb.compatibility, "");
  432.     strcpy(aminet.uploader,    "");
  433.     strcpy(agdb.output,        "");
  434.     strcpy(agdb.textfield,     "");
  435.  
  436.     if (display)
  437.         updateagdbgadgets();
  438. }
  439.  
  440. AGLOBAL void openagdb(void)
  441. {   if (asl("~(#?.info)"))
  442.     {   strcpy(agdb.output, aslresult);
  443.         loadagdb();
  444.         updateagdbgadgets();
  445. }   }
  446.  
  447. AGLOBAL void loadagdb(void)
  448. {   if (readin(agdb.output))
  449.     {   offset = 0;
  450.  
  451.         parse("Title:           ");
  452.         parse("\nPublisher:       ");
  453.         strcpy(agdb.title,         string);
  454.         parse("\nGame Type:       ");
  455.         strcpy(agdb.publisher,     string);
  456.         parse("\nPlayers:         ");
  457.         strcpy(agdb.gametype,      string);
  458.         parse("\nHD Installable:  ");
  459.         strcpy(agdb.players,       string);
  460.         parse("\nCompatibility:   ");
  461.         strcpy(agdb.hdinstallable, string);
  462.         parse("\nSubmission:      ");
  463.         strcpy(agdb.compatibility, string);
  464.         parse("\n\nReview:\n");
  465.         strcpy(aminet.uploader,    string);
  466.         parsetoend();
  467.         strcpy(agdb.textfield,     string);
  468.  
  469.         updateagdbgadgets();
  470. }   }
  471.  
  472. MODULE void updateagdbgadgets(void)
  473. {   SetGadgetAttrs
  474.     (   agdb_gadgets[GID_11_ST1], MainWindowPtr, NULL,
  475.         STRINGA_TextVal, agdb.title,
  476.         TAG_DONE
  477.     );
  478.     SetGadgetAttrs
  479.     (   agdb_gadgets[GID_11_ST2], MainWindowPtr, NULL,
  480.         STRINGA_TextVal, agdb.publisher,
  481.         TAG_DONE
  482.     );
  483.     SetGadgetAttrs
  484.     (   agdb_gadgets[GID_11_ST3], MainWindowPtr, NULL,
  485.         STRINGA_TextVal, agdb.gametype,
  486.         TAG_DONE
  487.     );
  488.     SetGadgetAttrs
  489.     (   agdb_gadgets[GID_11_ST4], MainWindowPtr, NULL,
  490.         STRINGA_TextVal, agdb.players,
  491.         TAG_DONE
  492.     );
  493.     SetGadgetAttrs
  494.     (   agdb_gadgets[GID_11_ST5], MainWindowPtr, NULL,
  495.         STRINGA_TextVal, agdb.hdinstallable,
  496.         TAG_DONE
  497.     );
  498.     SetGadgetAttrs
  499.     (   agdb_gadgets[GID_11_ST6], MainWindowPtr, NULL,
  500.         STRINGA_TextVal, agdb.compatibility,
  501.         TAG_DONE
  502.     );
  503.     SetGadgetAttrs
  504.     (   agdb_gadgets[GID_11_ST7], MainWindowPtr, NULL,
  505.         STRINGA_TextVal, aminet.uploader,
  506.         TAG_DONE
  507.     );
  508.     SetGadgetAttrs
  509.     (   agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL,
  510.         GA_TEXTEDITOR_Contents, aminet.textfield,
  511.         TAG_DONE
  512.     );
  513. }
  514.  
  515. MODULE void readagdbgadgets(void)
  516. {   STRPTR textBuffer;
  517.  
  518.     if (!(GetAttr
  519.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST1], (ULONG *) agdb.title
  520.     )))
  521.     {   rq("Unsupported inquiry!"); // should never happen
  522.     }
  523.     if (!(GetAttr
  524.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST2], (ULONG *) agdb.publisher
  525.     )))
  526.     {   rq("Unsupported inquiry!"); // should never happen
  527.     }
  528.     if (!(GetAttr
  529.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST3], (ULONG *) agdb.gametype
  530.     )))
  531.     {   rq("Unsupported inquiry!"); // should never happen
  532.     }
  533.     if (!(GetAttr
  534.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST4], (ULONG *) agdb.players
  535.     )))
  536.     {   rq("Unsupported inquiry!"); // should never happen
  537.     }
  538.     if (!(GetAttr
  539.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST5], (ULONG *) agdb.hdinstallable
  540.     )))
  541.     {   rq("Unsupported inquiry!"); // should never happen
  542.     }
  543.     if (!(GetAttr                              
  544.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST6], (ULONG *) agdb.compatibility
  545.     )))
  546.     {   rq("Unsupported inquiry!"); // should never happen
  547.     }
  548.     if (!(GetAttr
  549.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST7], (ULONG *) aminet.uploader
  550.     )))
  551.     {   rq("Unsupported inquiry!"); // should never happen
  552.     }
  553.  
  554.     textBuffer = (STRPTR) DoGadgetMethod(agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL, GM_TEXTEDITOR_ExportText, NULL);
  555.     strcpy(agdb.textfield, textBuffer); // long description
  556.     FreeVec((APTR) textBuffer);
  557.     // textBuffer = NULL;
  558. }
  559.